package com.aishua.fire.controller.sysmanager;

import java.util.List;
import java.util.Map;

import javax.validation.Valid;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import com.aishua.fire.common.ValidateUtil;
import com.aishua.fire.common.anno.ModuleService;
import com.aishua.fire.common.anno.PermMapping;
import com.aishua.fire.common.constant.BigMenuConstants;
import com.aishua.fire.common.constant.ModuleConstants;
import com.aishua.fire.common.exp.ValidateException;
import com.aishua.fire.config.init.Init;
import com.aishua.fire.entity.ateampteam.AddAteamPteamInfo;
import com.aishua.fire.entity.ateampteam.AteamPteamListSearchInfo;
import com.aishua.fire.entity.ateampteam.UpdateAteamPteamInfo;
import com.aishua.fire.entity.perm.PermInfo;
import com.aishua.fire.entity.perm.PermSearchInfo;
import com.aishua.fire.entity.permpermteam.PermpermteamInfo;
import com.aishua.fire.entity.permteam.PermteamInfo;
import com.aishua.fire.jpa.entity.AccountteamPermteam;
import com.aishua.fire.jpa.entity.OneLevelMenu;
import com.aishua.fire.jpa.entity.Perm;
import com.aishua.fire.jpa.entity.Permteam;
import com.aishua.fire.jpa.entity.TwoLevelMenu;
import com.aishua.fire.mapper.AteamPermteamMapper;
import com.aishua.fire.mapper.PermpermteamMapper;
import com.aishua.fire.mapper.dto.AccountteamPermteamDto;
import com.aishua.fire.mapper.dto.AteamPermteamDto;
import com.aishua.fire.mapper.dto.PermPermteamDto;
import com.aishua.fire.mapper.dto.PermteamDto;
import com.aishua.fire.service.AccountteamPermteamService;
import com.aishua.fire.service.PermPermteamService;
import com.aishua.fire.service.PermService;
import com.aishua.fire.service.PermteamService;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j;

@Api(value = "系统权限",tags = {"系统权限接口"})
@RestController
@Slf4j
public class SystemPermissionController {

	@Autowired
	private AccountteamPermteamService ateampteamService;
	@Autowired
	private PermteamService permteamService;
	@Autowired
	private PermPermteamService permPermteamService;
	@Autowired
	private PermService permservice;
	@Autowired
	private PermpermteamMapper permpermteamMapper;
	@Autowired
	private AteamPermteamMapper ateamPermteamMapper;
	@Autowired
	private Init init;
	@Autowired
	private ValidateUtil validateUtil;
	
	@ModuleService(totalModule=BigMenuConstants.systemManager,moduleName=ModuleConstants.systemPermission)
	@ApiOperation(value="添加_角色访问控制")
	@PostMapping(value = {"/ateampteam"} )
	public int add(@RequestBody @ApiParam(name="账户组添加信息对象",value="传入json格式",required=true) AddAteamPteamInfo addAteamPteamInfo) {
		log.info("账户组访问控制添加:{}",addAteamPteamInfo);
		AteamPermteamDto ateamPermteamDto = new AteamPermteamDto();
		ateamPermteamDto.setAccountteamId(Long.parseLong(addAteamPteamInfo.getAccountteamId()));
		ateamPermteamDto.setPermteamId(Long.parseLong(addAteamPteamInfo.getPermteamId()));
		ateamPermteamDto.setAuthAction(addAteamPteamInfo.getAuth_action());
		ateamPermteamDto.setAuthType(addAteamPteamInfo.getAuth_type());
	if(ateamPermteamMapper.findCountAteamPermteam(ateamPermteamDto) == 0){	
		ateampteamService.add(ateamPermteamDto);
		init.initUrlMap(false);
//        init.initDBMap(false);
        return 0;
	}else {
		return 1;
    }
  }
	
	
	
	/** 此处删除均为软删除 **/
	@ModuleService(totalModule=BigMenuConstants.systemManager,moduleName=ModuleConstants.systemPermission)
	@ApiOperation(value="删除_角色访问控制")
	@DeleteMapping(value = {"/ateampteam/{ateamId}/{pteamId}"} )
	public void delete(@PathVariable("ateamId") @ApiParam(name="账户组id",value="传入json格式",required=true) String ateamId,
			@PathVariable("pteamId") @ApiParam(name="权限组id",value="传入json格式",required=true) String pteamId) {
		log.info("账户组访问控制删除:{},{}",ateamId,pteamId);
		AteamPermteamDto ateamPermteamDto = new AteamPermteamDto();
		ateamPermteamDto.setPermteamId(Long.parseLong(pteamId));
		ateamPermteamDto.setAccountteamId(Long.parseLong(ateamId));
		ateampteamService.delete(ateamPermteamDto);
		init.initUrlMap(false);
		
//        init.initDBMap(false);
    }
	
	@ModuleService(totalModule=BigMenuConstants.systemManager,moduleName=ModuleConstants.systemPermission)
	@ApiOperation(value="修改_角色访问控制")
	@PutMapping(value = {"/ateampteam"} )
	public void update(@RequestBody @ApiParam(name="账户组更新信息对象",value="传入json格式",required=true) UpdateAteamPteamInfo updateAteamPteamInfo) {
		log.info("账户组访问控制修改:{}",updateAteamPteamInfo);
		ateampteamService.update(updateAteamPteamInfo);
		init.initUrlMap(false);
		
//        init.initDBMap(false);
    }
	
	@ModuleService(totalModule=BigMenuConstants.systemManager,moduleName=ModuleConstants.systemPermission)
	@ApiOperation(value="修改_角色访问控制")
	@PostMapping(value = {"/ateampteamup"} )
	public void updateateam(@RequestBody @ApiParam(name="账户组更新信息对象",value="传入json格式",required=true) UpdateAteamPteamInfo updateAteamPteamInfo) {
		log.info("账户组访问控制修改:{}",updateAteamPteamInfo);
		AteamPermteamDto ateamPermteamDto = new AteamPermteamDto();
		ateamPermteamDto.setAccountteamId(Long.parseLong(updateAteamPteamInfo.getAccountteamId()));
		ateamPermteamDto.setAccountteamIdNew(Long.parseLong(updateAteamPteamInfo.getAccountteamIdNew()));
		ateamPermteamDto.setAuthAction(updateAteamPteamInfo.getAuth_action());
		ateamPermteamDto.setAuthType(updateAteamPteamInfo.getAuth_type());
		ateamPermteamDto.setPermteamId(Long.parseLong(updateAteamPteamInfo.getPermteamId()));
		ateampteamService.updateateam(ateamPermteamDto);
		init.initUrlMap(false);
		
//        init.initDBMap(false);
    }
	
	@ModuleService(totalModule=BigMenuConstants.systemManager,moduleName=ModuleConstants.systemPermission)
	@ApiOperation(value="查询_角色访问控制详情")
	@GetMapping(value = {"/ateampteam/{ateamId}/{pteamId}"} )
	public AccountteamPermteam get(@PathVariable("ateamId") @ApiParam(name="账户组id",value="传入json格式",required=true) String ateamId,
			@PathVariable("pteamId") @ApiParam(name="权限组id",value="传入json格式",required=true) String pteamId) {
		log.info("账户组访问控制查询详情:{},{}",ateamId,pteamId);
		return ateampteamService.findDetailByPK(ateamId,pteamId);
    }
	
	@ModuleService(totalModule=BigMenuConstants.systemManager,moduleName=ModuleConstants.systemPermission)
	@ApiOperation(value="查询_角色信息列表")
	@PostMapping(value = {"/ateampteamList"} )
	public Page<AccountteamPermteam> roleList(AteamPteamListSearchInfo roleSearchInfo) {
		log.info("账户组访问控制分页列表查询列表:{}",roleSearchInfo);
        return ateampteamService.searchList(roleSearchInfo.getPage(), roleSearchInfo.getSize(), roleSearchInfo.getAuthAction(),roleSearchInfo.getAuthType());
    }
	
	/**
	 * 
	 * post http://localhost:8080/ateampteam/findAllByAccountteamId/1
	 */
	@ModuleService(totalModule=BigMenuConstants.systemManager,moduleName=ModuleConstants.systemPermission)
	@ApiOperation(value="查询_角色id找到对应的账户组-权限组信息")
	@PostMapping(value = {"/ateampteam/findAllByAccountteamId"} )
	public Map<String,Object> findByaccountteamId(@RequestBody @ApiParam(name="通过账户组id查询账户权限",value="传入json格式",required=true) Long accountteamId) {
		log.info("查询账户组id:{}",accountteamId);
		Map<String, Object> map = ateampteamService.findAllByAccountteamId(accountteamId);
		return map;
    }
	
	/**
	   * 授权信息
	   */
	@ModuleService(totalModule=BigMenuConstants.systemManager,moduleName=ModuleConstants.systemPermission)
	@ApiOperation(value="查询_授权信息")
	@GetMapping(value = {"/ateampteam/{permteamId}"} )
	public List<AccountteamPermteamDto> getAteampteam(@PathVariable("permteamId") @ApiParam(name="权限组id",value="传入json格式",required=true) String permteamId){ 
		log.info("权限组id:{}",permteamId);
		List<AccountteamPermteamDto> accteamPermteamInfo = ateampteamService.getAccteamPermteamInfo(permteamId);
		return accteamPermteamInfo;
    }
	
	/**
	 * 全查
	 * post http://localhost:8080/ateampteam/ateampteamListAll
	 * []
	 */
	@ModuleService(totalModule=BigMenuConstants.systemManager,moduleName=ModuleConstants.systemPermission)
	@ApiOperation(value="查询_角色权限组（全查）")
	@GetMapping(value = {"/ateampteam/ateampteamListAll"} )
	public List<AccountteamPermteam> ateampteamList() {
		log.info("账户组全查+++++++++++++");
		List<AccountteamPermteam> accountteamPermteams = ateampteamService.searchList();
        return accountteamPermteams;
    }
	
	/**
	 * 测试报文：post  http://localhost:8080/permteamList
	 * 
	 * {
		  "permteamName":"ADMIN_Permission"
		 
		}
	 * 
	 * 返回报文：
	 * {
		    "content": [
		        {
		            "permteamId": 1,
		            "permTeamName": "ADMIN_Permission",
		            "permTeamDesc": "123",
		            "createDate": 1519784946000,
		            "status": "0"
		        }
		    ],
		    "last": true,
		    "totalElements": 1,
		    "totalPages": 1,
		    "number": 0,
		    "size": 9,
		    "numberOfElements": 1,
		    "sort": [
		        {
		            "direction": "ASC",
		            "property": "permTeamName",
		            "ignoreCase": false,
		            "nullHandling": "NATIVE",
		            "descending": false,
		            "ascending": true
		        }
		    ],
		    "first": true
		}
	 * 
	 */
	@ModuleService(totalModule=BigMenuConstants.systemManager,moduleName=ModuleConstants.systemPermission)
	@ApiOperation(value="查询_权限组信息列表")
    @PostMapping(value = {"/permteamList"} )
	public List<Permteam> permteamList() {
        return permteamService.searchList();
    }
	
	/**
	 * 测试报文: post  http://localhost:8080/permteam
	 * 
	 * {
		  "permteamDesc": "一级供应商默认权限,可用于快速赋予一级供应商权限",
		  "permteamName": "一级供应商默认权限"
		}
	 * @throws ValidateException 
	 */
	@ModuleService(totalModule=BigMenuConstants.systemManager,moduleName=ModuleConstants.systemPermission)
	@ApiOperation(value="添加_权限组信息")
    @PostMapping(value = {"/permteam"} )
	public void add(@RequestBody @Valid PermteamInfo PermteamInfo,BindingResult result) throws ValidateException {
		log.info("添加权限组信息日志:{}",PermteamInfo);
		validateUtil.respErrorMsg(result);
		PermteamDto permteamDto = new PermteamDto();
		permteamDto.setPermTeamDesc(PermteamInfo.getPermteamDesc());
		permteamDto.setPermTeamName(PermteamInfo.getPermteamName());
		permteamService.addPermteamInfo(permteamDto);
		init.initUrlMap(false);
//        init.initDBMap(false);
	}
	
	/**
	 * 测试报文: put  http://localhost:8080/permteam/1
	 * 
	 * {
		  "permteamDesc": "一级供权限",
		  "permteamName": "一级默认权限"
		}
	 * @throws ValidateException 
	 */
	@ModuleService(totalModule=BigMenuConstants.systemManager,moduleName=ModuleConstants.systemPermission)
	@ApiOperation(value="修改_权限组信息")
    @PostMapping(value = {"/permteamUp"} )
	public void update(@RequestBody @Valid PermteamInfo PermteamInfo,BindingResult result) throws ValidateException {
		log.info("更新权限组信息日志:{}",PermteamInfo);
		validateUtil.respErrorMsg(result);
		PermteamDto permteamDto = new PermteamDto();
		permteamDto.setPermteamId(Long.parseLong(PermteamInfo.getPermteamId()));
		permteamDto.setPermTeamDesc(PermteamInfo.getPermteamDesc());
		permteamDto.setPermTeamName(PermteamInfo.getPermteamName());
		permteamService.updatePermteamInfo(permteamDto);
    }
	
	/**
	 * 测试报文: delete  http://localhost:8080/permteam/1
	 *     此处为 软删除  表中 status 字段 由 0 更新为 1
	 */
	@ModuleService(totalModule=BigMenuConstants.systemManager,moduleName=ModuleConstants.systemPermission)
	@ApiOperation(value="删除_权限组信息")
    @DeleteMapping(value = {"/permteam/{permteamId}"} )
	public void deletePermteam(@PathVariable @ApiParam(name="permteamId",value="例如:0000",required=true) String permteamId) {
		log.info("删除权限组信息id日志:{}",permteamId);
		PermteamDto permteamDto = new PermteamDto();
		permteamDto.setPermteamId(Long.parseLong(permteamId));
		permteamService.deletePermteamInfo(permteamDto);
		init.initUrlMap(false);
//        init.initDBMap(false);
    }
	
	/**
	 * 测试报文: get  http://localhost:8080/permteam/1
	 * 
	 *  {
        "permteamId": 1,
        "permTeamName": "一级默认权限",
        "permTeamDesc": "一级供权限",
        "createDate": 1519722662000,
        "status": "0"
        }
	 */
	/** 权限组通过权限id查询权限组信息 **/
	@ModuleService(totalModule=BigMenuConstants.systemManager,moduleName=ModuleConstants.systemPermission)
	@ApiOperation(value="查询_通过权限id查询权限组信息 ")
	@GetMapping(value = {"/permteam/{permId}"} )
	public List<Permteam> getPermteamList(@PathVariable("permId") @ApiParam(name="登录账户id",value="类如:0000",required=true) String permId) {
		log.info("查询账户id:{}",permId);
		return permteamService.getPermteamListByPermId(permId);
    }
	
    /** 通过权限组id查询权限资源信息 **/
	@ModuleService(totalModule=BigMenuConstants.systemManager,moduleName=ModuleConstants.systemPermission)
	@ApiOperation(value="查询_通过权限组id查询权限资源信息 ")
	@GetMapping(value = {"/permpermt/{permteamId}"} )
	public List<PermPermteamDto> getPermListByPermteamId(@PathVariable("permteamId") @ApiParam(name="权限组id",value="类如:00",required=true) String permteamId) {
		log.info("查询账户id:{}",permteamId);
		return permteamService.getPermListByPermteamId(permteamId);
    }
	
	/** 点击新增资源获取下拉框权限名列表 **/
	/*@ModuleService(totalModule=BigMenuConstants.systemManager,moduleName=ModuleConstants.systemPermission)
	@ApiOperation(value="点击新增资源之前,获取权限名下拉框列表信息 ")
	@GetMapping(value = {"/permList/{permteamId}"} )
	public List<Perm> getPermallList(@PathVariable("permteamId") String permteamId) {
		log.info("获取权限信息:{}",permteamId);
		return permteamService.getPermallList(permteamId);
    }*/
	
	/**
	 * 测试报文：post http://localhost:8080/permPermteam
	 * 
	 * {
		  "permteamId":"2",
		  "permId":"2"
		}
	 * 
	 * 
	 */
	@ModuleService(totalModule=BigMenuConstants.systemManager,moduleName=ModuleConstants.systemPermission)
	@ApiOperation(value="添加_权限组添加权限")
    @PostMapping(value = {"/permPermteam"} )
	public void addPermPermteam(@RequestBody PermpermteamInfo permpermteamInfo) {
	   log.info("权限中间表添加信息日志:{}",permpermteamInfo);
	   permPermteamService.addPermPermteam(permpermteamInfo);
	   init.initUrlMap(false);
//       init.initDBMap(false);
    }

	
	
	/**
	 * 测试报文：delete  http://localhost:8080/permPermteam/2/2
	 * 
	 * 
	 */
	@ModuleService(totalModule=BigMenuConstants.systemManager,moduleName=ModuleConstants.systemPermission)
	@ApiOperation(value="删除_权限组删除子权限信息")
	@DeleteMapping(value = {"/permPermteam/{permteamId}/{permId}"} )
	public void deletePermPermteam(@PathVariable @ApiParam(name="权限组id",value="传入json格式",required=true) String permteamId,
			                             @PathVariable @ApiParam(name="权限id",value="传入json格式",required=true) String permId) {
		PermpermteamInfo permpermteamInfo = new PermpermteamInfo();
		permpermteamInfo.setPermteamId(Long.parseLong(permteamId));
		permpermteamInfo.setPermId(Long.parseLong(permId));
	    log.info("权限组删除子权限信息日志:{}",permpermteamInfo);
	    PermPermteamDto permPermteamDto = new PermPermteamDto();
	    permPermteamDto.setPermId(Long.parseLong(permId));
	    permPermteamDto.setPermteamId(Long.parseLong(permteamId));
	    permPermteamService.deletePermPermteam(permPermteamDto);
	    init.initUrlMap(false);
		
//        init.initDBMap(false);
    }
	
	/**
	 * 更新权限组中间表信息
	 * 
	 * 
	 */
	@ModuleService(totalModule=BigMenuConstants.systemManager,moduleName=ModuleConstants.systemPermission)
	@ApiOperation(value="修改_权限组中子权限信息")
	@PutMapping(value = {"/permPermteam/{permteamId}/{permId}/{permIdNew}"} )
	public int updatePermPermteam(@PathVariable @ApiParam(name="权限组permteamId",value="传入json格式",required=true) String permteamId,
			                             @PathVariable @ApiParam(name="权限permId",value="传入json格式",required=true) String permId,
			                             @PathVariable @ApiParam(name="权限permIdNew",value="传入json格式",required=true) String permIdNew) {
	   log.info("更新权限中间表信息日志:{}",permIdNew);
	   PermPermteamDto permPermteamDto = new PermPermteamDto();
	   permPermteamDto.setPermId(Long.parseLong(permId));
	   permPermteamDto.setPermIdNew(Long.parseLong(permIdNew));
	   permPermteamDto.setPermteamId(Long.parseLong(permteamId));
	  if(permpermteamMapper.findCountPermPermteamUp(permPermteamDto)==0) {
			   permPermteamService.updatePermPermteam(permPermteamDto);
			   
			   init.initUrlMap(false);
//		       init.initDBMap(false);
		       return 2;
	  }else {
		  
		     return 3;
	  }
    }
	
	/**
	 * 测试报文: post  http://localhost:8080/permList
	 * {
		  "permName":"/permList"
		}
	 * 
	 * 返回报文：
	 *    {
		    "content": [
		        {
		            "permId": 27,
		            "permName": "/permList",
		            "permDesc": "权限分页列表查询接口",
		            "requestMethod": "POST",
		            "createDate": 1519783887000,
		            "status": "0"
		        }
		    ],
		    "totalPages": 1,
		    "totalElements": 1,
		    "last": true,
		    "number": 0,
		    "size": 9,
		    "sort": [
		        {
		            "direction": "ASC",
		            "property": "permName",
		            "ignoreCase": false,
		            "nullHandling": "NATIVE",
		            "descending": false,
		            "ascending": true
		        }
		    ],
		    "first": true,
		    "numberOfElements": 1
      }
	 */
	@ModuleService(totalModule=BigMenuConstants.systemManager,moduleName=ModuleConstants.systemPermission)
	@ApiOperation(value="查询_权限信息列表")
    @PostMapping(value = {"/permList"} )
	public Page<Perm> permList(@RequestBody PermSearchInfo PermSearchInfo) {
        return permservice.searchList(PermSearchInfo.getCurPage()-1, PermSearchInfo.getRows()-1, PermSearchInfo.getPermName());
    }
	
	@ModuleService(totalModule=BigMenuConstants.systemManager,moduleName=ModuleConstants.systemPermission)
	@ApiOperation(value="修改_权限信息")
    @PutMapping(value = {"/perm/{PermId}"} )
	public void update(@PathVariable @ApiParam(name="权限id",value="例如:0000",required=true) String PermId,
			                 @RequestBody @ApiParam(name="权限更新信息对象",value="传入json格式",required=true) PermInfo PermInfo) {
		log.info("更新权限信息日志:{}",PermInfo);
		permservice.updatePermInfo(PermInfo, PermId);
    }
	
	/** 此处删除均为软删除 **/
	@ModuleService(totalModule=BigMenuConstants.systemManager,moduleName=ModuleConstants.systemPermission)
	@ApiOperation(value="删除_权限信息")
    @DeleteMapping(value = {"/perm/{PermId}"} )
	public void delete(@PathVariable @ApiParam(name="权限id",value="例如:0000",required=true) String PermId) {
		log.info("删除权限信息id日志:{}",PermId);
		permservice.deletePermInfo(PermId);
    }
	
	/**
	 * 测试报文：get  http://localhost:8080/perm/3
	 * 
	 * 返回报文：
	 *  {
        "permId": 3,
        "permName": "/account",
        "permDesc": "添加账户信息接口",
        "requestMethod": "POST",
        "createDate": 1519783886000,
        "status": "0"
        }
	 * 
	 * 
	 */
	/** 权限通过权限id查询权限信息 **/
	@ModuleService(totalModule=BigMenuConstants.systemManager,moduleName=ModuleConstants.systemPermission)
	@ApiOperation(value="查询_权限组下所有权限信息 ")
	@GetMapping(value = {"/perm/{permteamId}"} )
	public List<Perm> getPermList(@PathVariable("permteamId") @ApiParam(name="登录账户id",value="类如:0000",required=true) String permteamId) {
		log.info("查询账户id:{}",permteamId);
		return permservice.getPermListByPermteamId(permteamId);
    }

	/** 点击二级菜单显示三级菜单 **/
	/*@ModuleService(totalModule=BigMenuConstants.systemManager,moduleName=ModuleConstants.systemPermission)
	@ApiOperation(value="权限点击二级菜单显示三级菜单接口 ")
	@GetMapping(value = {"/permThreeLevel/{controllerValue}/{permteamId}"} )
	public List<PermDto> getPermThreeLevel(@PathVariable("controllerValue") @ApiParam(name="传入截取的控制层名",value="类如:ProductPriceController",required=true) String controllerValue,
			             @PathVariable("permteamId") @ApiParam(name="权限组id",value="类如:001",required=true) String permteamId) {
		log.info("传入截取的控制层名:{}",controllerValue);
		return permservice.getPermThreeLevel(controllerValue, permteamId);
    }*/
	
	@PermMapping(onlyLogin = true)
	@ModuleService(totalModule=BigMenuConstants.systemManager,moduleName=ModuleConstants.systemPermission)
	@ApiOperation(value="获取一级菜单列表 ")
	@GetMapping(value = {"/getOneLevelMenus"})
	public List<OneLevelMenu> getOneLevelMenus(){
		return permservice.getOneLevelMenus();
	}

	@PermMapping(onlyLogin = true)
	@ModuleService(totalModule=BigMenuConstants.systemManager,moduleName=ModuleConstants.systemPermission)
	@ApiOperation(value="获取二级菜单列表 ")
	@GetMapping(value = {"/getTwoLevelMenus/{oneLevelId}"})
	public List<TwoLevelMenu> getTwoLevelMenus(@PathVariable("oneLevelId") String oneLevelId){
		log.info("oneLevelId值:{}",oneLevelId);
		return permservice.getTwoLevelMenus(oneLevelId);
	}
	
	@PermMapping(onlyLogin = true)
	@ModuleService(totalModule=BigMenuConstants.systemManager,moduleName=ModuleConstants.systemPermission)
	@ApiOperation(value="获取三级菜单列表 ")
	@GetMapping(value = {"/getPermsByTwoLevelId/{twoLevelId}"})
	public List<Perm> getPermsByTwoLevelId(@PathVariable("twoLevelId") String twoLevelId) {
		log.info("twoLevelId值:{}",twoLevelId);
		return permservice.getPermsByTwoLevelId(twoLevelId);
	}
}
